// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// A resource that represents a Secure Source Manager instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
    /// Optional. A unique identifier for an instance. The name should be of the
    /// format:
    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
    ///
    /// `project_number`: Maps to a unique int64 id assigned to each project.
    ///
    /// `location_id`: Refers to the region where the instance will be deployed.
    /// Since Secure Source Manager is a regional service, it must be one of the
    /// valid GCP regions.
    ///
    /// `instance_id`: User provided name for the instance, must be unique for a
    /// project_number and location_id combination.
    pub name: std::string::String,

    /// Output only. Create timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Labels as key value pairs.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. Private settings for private instance.
    pub private_config: std::option::Option<crate::model::instance::PrivateConfig>,

    /// Output only. Current state of the instance.
    pub state: crate::model::instance::State,

    /// Output only. An optional field providing information about the current
    /// instance state.
    pub state_note: crate::model::instance::StateNote,

    /// Optional. Immutable. Customer-managed encryption key name, in the format
    /// projects/*/locations/*/keyRings/*/cryptoKeys/*.
    pub kms_key: std::string::String,

    /// Output only. A list of hostnames for this instance.
    pub host_config: std::option::Option<crate::model::instance::HostConfig>,

    /// Optional. Configuration for Workforce Identity Federation to support
    /// third party identity provider. If unset, defaults to the Google OIDC IdP.
    pub workforce_identity_federation_config:
        std::option::Option<crate::model::instance::WorkforceIdentityFederationConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Instance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Instance::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Instance::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Instance::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Instance::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [private_config][crate::model::Instance::private_config].
    pub fn set_private_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::instance::PrivateConfig>,
    {
        self.private_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [private_config][crate::model::Instance::private_config].
    pub fn set_or_clear_private_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::instance::PrivateConfig>,
    {
        self.private_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Instance::state].
    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [state_note][crate::model::Instance::state_note].
    pub fn set_state_note<T: std::convert::Into<crate::model::instance::StateNote>>(
        mut self,
        v: T,
    ) -> Self {
        self.state_note = v.into();
        self
    }

    /// Sets the value of [kms_key][crate::model::Instance::kms_key].
    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key = v.into();
        self
    }

    /// Sets the value of [host_config][crate::model::Instance::host_config].
    pub fn set_host_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::instance::HostConfig>,
    {
        self.host_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [host_config][crate::model::Instance::host_config].
    pub fn set_or_clear_host_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::instance::HostConfig>,
    {
        self.host_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
    pub fn set_workforce_identity_federation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
    {
        self.workforce_identity_federation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
    pub fn set_or_clear_workforce_identity_federation_config<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
    {
        self.workforce_identity_federation_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Instance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance"
    }
}

/// Defines additional types related to [Instance].
pub mod instance {
    #[allow(unused_imports)]
    use super::*;

    /// HostConfig has different instance endpoints.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HostConfig {
        /// Output only. HTML hostname.
        pub html: std::string::String,

        /// Output only. API hostname.
        pub api: std::string::String,

        /// Output only. Git HTTP hostname.
        pub git_http: std::string::String,

        /// Output only. Git SSH hostname.
        pub git_ssh: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HostConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [html][crate::model::instance::HostConfig::html].
        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.html = v.into();
            self
        }

        /// Sets the value of [api][crate::model::instance::HostConfig::api].
        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.api = v.into();
            self
        }

        /// Sets the value of [git_http][crate::model::instance::HostConfig::git_http].
        pub fn set_git_http<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.git_http = v.into();
            self
        }

        /// Sets the value of [git_ssh][crate::model::instance::HostConfig::git_ssh].
        pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.git_ssh = v.into();
            self
        }
    }

    impl wkt::message::Message for HostConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.HostConfig"
        }
    }

    /// PrivateConfig includes settings for private instance.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PrivateConfig {
        /// Required. Immutable. Indicate if it's private instance.
        pub is_private: bool,

        /// Optional. Immutable. CA pool resource, resource must in the format of
        /// `projects/{project}/locations/{location}/caPools/{ca_pool}`.
        pub ca_pool: std::string::String,

        /// Output only. Service Attachment for HTTP, resource is in the format of
        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
        pub http_service_attachment: std::string::String,

        /// Output only. Service Attachment for SSH, resource is in the format of
        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
        pub ssh_service_attachment: std::string::String,

        /// Optional. Additional allowed projects for setting up PSC connections.
        /// Instance host project is automatically allowed and does not need to be
        /// included in this list.
        pub psc_allowed_projects: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PrivateConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [is_private][crate::model::instance::PrivateConfig::is_private].
        pub fn set_is_private<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.is_private = v.into();
            self
        }

        /// Sets the value of [ca_pool][crate::model::instance::PrivateConfig::ca_pool].
        pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ca_pool = v.into();
            self
        }

        /// Sets the value of [http_service_attachment][crate::model::instance::PrivateConfig::http_service_attachment].
        pub fn set_http_service_attachment<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.http_service_attachment = v.into();
            self
        }

        /// Sets the value of [ssh_service_attachment][crate::model::instance::PrivateConfig::ssh_service_attachment].
        pub fn set_ssh_service_attachment<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.ssh_service_attachment = v.into();
            self
        }

        /// Sets the value of [psc_allowed_projects][crate::model::instance::PrivateConfig::psc_allowed_projects].
        pub fn set_psc_allowed_projects<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.psc_allowed_projects = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for PrivateConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig"
        }
    }

    /// WorkforceIdentityFederationConfig allows this instance to support users
    /// from external identity providers.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct WorkforceIdentityFederationConfig {
        /// Optional. Immutable. Whether Workforce Identity Federation is enabled.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl WorkforceIdentityFederationConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::instance::WorkforceIdentityFederationConfig::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for WorkforceIdentityFederationConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig"
        }
    }

    /// Secure Source Manager instance state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Not set. This should only be the case for incoming requests.
        Unspecified,
        /// Instance is being created.
        Creating,
        /// Instance is ready.
        Active,
        /// Instance is being deleted.
        Deleting,
        /// Instance is paused.
        Paused,
        /// Instance is unknown, we are not sure if it's functioning.
        Unknown,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::Paused => std::option::Option::Some(4),
                Self::Unknown => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Paused => std::option::Option::Some("PAUSED"),
                Self::Unknown => std::option::Option::Some("UNKNOWN"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                4 => Self::Paused,
                6 => Self::Unknown,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                "PAUSED" => Self::Paused,
                "UNKNOWN" => Self::Unknown,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::Paused => serializer.serialize_i32(4),
                Self::Unknown => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.securesourcemanager.v1.Instance.State",
            ))
        }
    }

    /// Provides information about the current instance state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum StateNote {
        /// STATE_NOTE_UNSPECIFIED as the first value of State.
        Unspecified,
        /// CMEK access is unavailable.
        PausedCmekUnavailable,
        /// INSTANCE_RESUMING indicates that the instance was previously paused
        /// and is under the process of being brought back.
        #[deprecated]
        InstanceResuming,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [StateNote::value] or
        /// [StateNote::name].
        UnknownValue(state_note::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state_note {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl StateNote {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::PausedCmekUnavailable => std::option::Option::Some(1),
                Self::InstanceResuming => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_NOTE_UNSPECIFIED"),
                Self::PausedCmekUnavailable => std::option::Option::Some("PAUSED_CMEK_UNAVAILABLE"),
                Self::InstanceResuming => std::option::Option::Some("INSTANCE_RESUMING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for StateNote {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for StateNote {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for StateNote {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::PausedCmekUnavailable,
                2 => Self::InstanceResuming,
                _ => Self::UnknownValue(state_note::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for StateNote {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_NOTE_UNSPECIFIED" => Self::Unspecified,
                "PAUSED_CMEK_UNAVAILABLE" => Self::PausedCmekUnavailable,
                "INSTANCE_RESUMING" => Self::InstanceResuming,
                _ => Self::UnknownValue(state_note::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for StateNote {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::PausedCmekUnavailable => serializer.serialize_i32(1),
                Self::InstanceResuming => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for StateNote {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StateNote>::new(
                ".google.cloud.securesourcemanager.v1.Instance.StateNote",
            ))
        }
    }
}

/// Metadata of a Secure Source Manager repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Repository {
    /// Optional. A unique identifier for a repository. The name should be of the
    /// format:
    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}`
    pub name: std::string::String,

    /// Optional. Description of the repository, which cannot exceed 500
    /// characters.
    pub description: std::string::String,

    /// Optional. The name of the instance in which the repository is hosted,
    /// formatted as
    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
    /// When creating repository via securesourcemanager.googleapis.com, this field
    /// is used as input. When creating repository via *.sourcemanager.dev, this
    /// field is output only.
    pub instance: std::string::String,

    /// Output only. Unique identifier of the repository.
    pub uid: std::string::String,

    /// Output only. Create timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. This checksum is computed by the server based on the value of
    /// other fields, and may be sent on update and delete requests to ensure the
    /// client has an up-to-date value before proceeding.
    pub etag: std::string::String,

    /// Output only. URIs for the repository.
    pub uris: std::option::Option<crate::model::repository::URIs>,

    /// Input only. Initial configurations for the repository.
    pub initial_config: std::option::Option<crate::model::repository::InitialConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Repository {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Repository::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Repository::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [instance][crate::model::Repository::instance].
    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.instance = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::Repository::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Repository::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Repository::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [etag][crate::model::Repository::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [uris][crate::model::Repository::uris].
    pub fn set_uris<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::repository::URIs>,
    {
        self.uris = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [uris][crate::model::Repository::uris].
    pub fn set_or_clear_uris<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::repository::URIs>,
    {
        self.uris = v.map(|x| x.into());
        self
    }

    /// Sets the value of [initial_config][crate::model::Repository::initial_config].
    pub fn set_initial_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::repository::InitialConfig>,
    {
        self.initial_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [initial_config][crate::model::Repository::initial_config].
    pub fn set_or_clear_initial_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::repository::InitialConfig>,
    {
        self.initial_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Repository {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository"
    }
}

/// Defines additional types related to [Repository].
pub mod repository {
    #[allow(unused_imports)]
    use super::*;

    /// URIs for the repository.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct URIs {
        /// Output only. HTML is the URI for user to view the repository in a
        /// browser.
        pub html: std::string::String,

        /// Output only. git_https is the git HTTPS URI for git operations.
        pub git_https: std::string::String,

        /// Output only. API is the URI for API access.
        pub api: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl URIs {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [html][crate::model::repository::URIs::html].
        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.html = v.into();
            self
        }

        /// Sets the value of [git_https][crate::model::repository::URIs::git_https].
        pub fn set_git_https<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.git_https = v.into();
            self
        }

        /// Sets the value of [api][crate::model::repository::URIs::api].
        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.api = v.into();
            self
        }
    }

    impl wkt::message::Message for URIs {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.URIs"
        }
    }

    /// Repository initialization configuration.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct InitialConfig {
        /// Default branch name of the repository.
        pub default_branch: std::string::String,

        /// List of gitignore template names user can choose from.
        /// Valid values: actionscript, ada, agda, android,
        /// anjuta, ansible, appcelerator-titanium, app-engine, archives,
        /// arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel,
        /// bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook,
        /// clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer,
        /// common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda,
        /// cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox,
        /// drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm,
        /// emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism,
        /// expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com,
        /// fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg,
        /// gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images,
        /// infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll,
        /// jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks,
        /// kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel,
        /// lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium,
        /// logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven,
        /// mercurial, mercury, metals, meta-programming-system, meteor,
        /// microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans,
        /// nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave,
        /// opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6,
        /// phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing,
        /// psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket,
        /// rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam,
        /// sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up,
        /// slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text,
        /// sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags,
        /// terraform, tex, text-mate, textpattern, think-php, tortoise-git,
        /// turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim,
        /// virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf,
        /// web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo,
        /// yeoman, yii, zend-framework, zephir.
        pub gitignores: std::vec::Vec<std::string::String>,

        /// License template name user can choose from.
        /// Valid values: license-0bsd, license-389-exception, aal, abstyles,
        /// adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1,
        /// afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later,
        /// agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd,
        /// antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0,
        /// apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8,
        /// artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0,
        /// autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2,
        /// bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0,
        /// bootloader-exception, borceux, bsd-1-clause, bsd-2-clause,
        /// bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent,
        /// bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution,
        /// bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification,
        /// bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014,
        /// bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause,
        /// bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code,
        /// bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera,
        /// catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at,
        /// cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0,
        /// cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0,
        /// cc-by-nc-nd-3-0-igo, cc-by-nc-nd-4-0, cc-by-nc-sa-1-0, cc-by-nc-sa-2-0,
        /// cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0,
        /// cc-by-nd-3-0, cc-by-nd-4-0, cc-by-sa-1-0, cc-by-sa-2-0, cc-by-sa-2-0-uk,
        /// cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc,
        /// cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0,
        /// cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1,
        /// cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic,
        /// classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python,
        /// cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0,
        /// copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword,
        /// crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark,
        /// digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0,
        /// ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics,
        /// epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1,
        /// eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception,
        /// font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage,
        /// freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0,
        /// gcc-exception-3-1, gd, gfdl-1-1-invariants-only,
        /// gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only,
        /// gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later,
        /// gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later,
        /// gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later,
        /// gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only,
        /// gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only,
        /// gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later,
        /// giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot,
        /// gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later,
        /// gpl-3-0-linking-exception, gpl-3-0-linking-source-exception,
        /// gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report,
        /// hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy,
        /// i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2,
        /// info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc,
        /// jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica,
        /// lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later,
        /// lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr,
        /// libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception,
        /// liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib,
        /// linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0,
        /// lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index,
        /// mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna,
        /// mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2,
        /// mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl,
        /// mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3,
        /// naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl,
        /// nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1,
        /// nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0,
        /// ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0,
        /// odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1,
        /// ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0,
        /// ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2,
        /// oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2,
        /// oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml,
        /// openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception,
        /// opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0,
        /// o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01,
        /// plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0,
        /// postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils,
        /// python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1,
        /// qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl,
        /// ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0,
        /// sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl,
        /// sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94,
        /// spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3,
        /// swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1,
        /// tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0,
        /// unicode-dfs-2015, unicode-dfs-2016, unicode-tou,
        /// universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0,
        /// w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl,
        /// wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp,
        /// xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib,
        /// zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1.
        pub license: std::string::String,

        /// README template name.
        /// Valid template name(s) are: default.
        pub readme: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl InitialConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [default_branch][crate::model::repository::InitialConfig::default_branch].
        pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.default_branch = v.into();
            self
        }

        /// Sets the value of [gitignores][crate::model::repository::InitialConfig::gitignores].
        pub fn set_gitignores<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.gitignores = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [license][crate::model::repository::InitialConfig::license].
        pub fn set_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.license = v.into();
            self
        }

        /// Sets the value of [readme][crate::model::repository::InitialConfig::readme].
        pub fn set_readme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.readme = v.into();
            self
        }
    }

    impl wkt::message::Message for InitialConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.InitialConfig"
        }
    }
}

/// Metadata of a Secure Source Manager Hook.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Hook {
    /// Identifier. A unique identifier for a Hook. The name should be of the
    /// format:
    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
    pub name: std::string::String,

    /// Required. The target URI to which the payloads will be delivered.
    pub target_uri: std::string::String,

    /// Optional. Determines if the hook disabled or not.
    /// Set to true to stop sending traffic.
    pub disabled: bool,

    /// Optional. The events that trigger hook on.
    pub events: std::vec::Vec<crate::model::hook::HookEventType>,

    /// Output only. Create timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Unique identifier of the hook.
    pub uid: std::string::String,

    /// Optional. The trigger option for push events.
    pub push_option: std::option::Option<crate::model::hook::PushOption>,

    /// Optional. The sensitive query string to be appended to the target URI.
    pub sensitive_query_string: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Hook {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Hook::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [target_uri][crate::model::Hook::target_uri].
    pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target_uri = v.into();
        self
    }

    /// Sets the value of [disabled][crate::model::Hook::disabled].
    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.disabled = v.into();
        self
    }

    /// Sets the value of [events][crate::model::Hook::events].
    pub fn set_events<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::hook::HookEventType>,
    {
        use std::iter::Iterator;
        self.events = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::Hook::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Hook::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Hook::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Hook::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Hook::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [push_option][crate::model::Hook::push_option].
    pub fn set_push_option<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::hook::PushOption>,
    {
        self.push_option = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [push_option][crate::model::Hook::push_option].
    pub fn set_or_clear_push_option<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::hook::PushOption>,
    {
        self.push_option = v.map(|x| x.into());
        self
    }

    /// Sets the value of [sensitive_query_string][crate::model::Hook::sensitive_query_string].
    pub fn set_sensitive_query_string<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.sensitive_query_string = v.into();
        self
    }
}

impl wkt::message::Message for Hook {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook"
    }
}

/// Defines additional types related to [Hook].
pub mod hook {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PushOption {
        /// Optional. Trigger hook for matching branches only.
        /// Specified as glob pattern. If empty or *, events for all branches are
        /// reported. Examples: main, {main,release*}.
        /// See <https://pkg.go.dev/github.com/gobwas/glob> documentation.
        pub branch_filter: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PushOption {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [branch_filter][crate::model::hook::PushOption::branch_filter].
        pub fn set_branch_filter<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.branch_filter = v.into();
            self
        }
    }

    impl wkt::message::Message for PushOption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook.PushOption"
        }
    }

    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum HookEventType {
        /// Unspecified.
        Unspecified,
        /// Push events are triggered when pushing to the repository.
        Push,
        /// Pull request events are triggered when a pull request is opened, closed,
        /// reopened, or edited.
        PullRequest,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [HookEventType::value] or
        /// [HookEventType::name].
        UnknownValue(hook_event_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod hook_event_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl HookEventType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Push => std::option::Option::Some(1),
                Self::PullRequest => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
                Self::Push => std::option::Option::Some("PUSH"),
                Self::PullRequest => std::option::Option::Some("PULL_REQUEST"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for HookEventType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for HookEventType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for HookEventType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Push,
                2 => Self::PullRequest,
                _ => Self::UnknownValue(hook_event_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for HookEventType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "UNSPECIFIED" => Self::Unspecified,
                "PUSH" => Self::Push,
                "PULL_REQUEST" => Self::PullRequest,
                _ => Self::UnknownValue(hook_event_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for HookEventType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Push => serializer.serialize_i32(1),
                Self::PullRequest => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for HookEventType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HookEventType>::new(
                ".google.cloud.securesourcemanager.v1.Hook.HookEventType",
            ))
        }
    }
}

/// Metadata of a BranchRule. BranchRule is the protection rule to enforce
/// pre-defined rules on designated branches within a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BranchRule {
    /// Optional. A unique identifier for a BranchRule. The name should be of the
    /// format:
    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`
    pub name: std::string::String,

    /// Output only. Unique identifier of the repository.
    pub uid: std::string::String,

    /// Output only. Create timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. User annotations. These attributes can only be set and used by
    /// the user. See <https://google.aip.dev/128#annotations> for more details such
    /// as format and size limitations.
    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. This checksum is computed by the server based on the value of
    /// other fields, and may be sent on update and delete requests to ensure the
    /// client has an up-to-date value before proceeding.
    pub etag: std::string::String,

    /// Optional. The pattern of the branch that can match to this BranchRule.
    /// Specified as regex.
    /// .* for all branches. Examples: main, (main|release.*).
    /// Current MVP phase only support `.*` for wildcard.
    pub include_pattern: std::string::String,

    /// Optional. Determines if the branch rule is disabled or not.
    pub disabled: bool,

    /// Optional. Determines if the branch rule requires a pull request or not.
    pub require_pull_request: bool,

    /// Optional. The minimum number of reviews required for the branch rule to be
    /// matched.
    pub minimum_reviews_count: i32,

    /// Optional. The minimum number of approvals required for the branch rule to
    /// be matched.
    pub minimum_approvals_count: i32,

    /// Optional. Determines if require comments resolved before merging to the
    /// branch.
    pub require_comments_resolved: bool,

    /// Optional. Determines if allow stale reviews or approvals before merging to
    /// the branch.
    pub allow_stale_reviews: bool,

    /// Optional. Determines if require linear history before merging to the
    /// branch.
    pub require_linear_history: bool,

    /// Optional. List of required status checks before merging to the branch.
    pub required_status_checks: std::vec::Vec<crate::model::branch_rule::Check>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BranchRule {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::BranchRule::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::BranchRule::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::BranchRule::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::BranchRule::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::BranchRule::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::BranchRule::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [annotations][crate::model::BranchRule::annotations].
    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [etag][crate::model::BranchRule::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [include_pattern][crate::model::BranchRule::include_pattern].
    pub fn set_include_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.include_pattern = v.into();
        self
    }

    /// Sets the value of [disabled][crate::model::BranchRule::disabled].
    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.disabled = v.into();
        self
    }

    /// Sets the value of [require_pull_request][crate::model::BranchRule::require_pull_request].
    pub fn set_require_pull_request<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.require_pull_request = v.into();
        self
    }

    /// Sets the value of [minimum_reviews_count][crate::model::BranchRule::minimum_reviews_count].
    pub fn set_minimum_reviews_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.minimum_reviews_count = v.into();
        self
    }

    /// Sets the value of [minimum_approvals_count][crate::model::BranchRule::minimum_approvals_count].
    pub fn set_minimum_approvals_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.minimum_approvals_count = v.into();
        self
    }

    /// Sets the value of [require_comments_resolved][crate::model::BranchRule::require_comments_resolved].
    pub fn set_require_comments_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.require_comments_resolved = v.into();
        self
    }

    /// Sets the value of [allow_stale_reviews][crate::model::BranchRule::allow_stale_reviews].
    pub fn set_allow_stale_reviews<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_stale_reviews = v.into();
        self
    }

    /// Sets the value of [require_linear_history][crate::model::BranchRule::require_linear_history].
    pub fn set_require_linear_history<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.require_linear_history = v.into();
        self
    }

    /// Sets the value of [required_status_checks][crate::model::BranchRule::required_status_checks].
    pub fn set_required_status_checks<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::branch_rule::Check>,
    {
        use std::iter::Iterator;
        self.required_status_checks = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for BranchRule {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule"
    }
}

/// Defines additional types related to [BranchRule].
pub mod branch_rule {
    #[allow(unused_imports)]
    use super::*;

    /// Check is a type for status check.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Check {
        /// Required. The context of the check.
        pub context: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Check {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [context][crate::model::branch_rule::Check::context].
        pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.context = v.into();
            self
        }
    }

    impl wkt::message::Message for Check {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule.Check"
        }
    }
}

/// Metadata of a PullRequest. PullRequest is the request
/// from a user to merge a branch (head) into another branch (base).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PullRequest {
    /// Output only. A unique identifier for a PullRequest. The number appended at
    /// the end is generated by the server. Format:
    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}`
    pub name: std::string::String,

    /// Required. The pull request title.
    pub title: std::string::String,

    /// Optional. The pull request body. Provides a detailed description of the
    /// changes.
    pub body: std::string::String,

    /// Required. The branch to merge changes in.
    pub base: std::option::Option<crate::model::pull_request::Branch>,

    /// Immutable. The branch containing the changes to be merged.
    pub head: std::option::Option<crate::model::pull_request::Branch>,

    /// Output only. State of the pull request (open, closed or merged).
    pub state: crate::model::pull_request::State,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last updated timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Close timestamp (if closed or merged). Cleared when pull
    /// request is re-opened.
    pub close_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PullRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PullRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [title][crate::model::PullRequest::title].
    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.title = v.into();
        self
    }

    /// Sets the value of [body][crate::model::PullRequest::body].
    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.body = v.into();
        self
    }

    /// Sets the value of [base][crate::model::PullRequest::base].
    pub fn set_base<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::pull_request::Branch>,
    {
        self.base = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [base][crate::model::PullRequest::base].
    pub fn set_or_clear_base<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::pull_request::Branch>,
    {
        self.base = v.map(|x| x.into());
        self
    }

    /// Sets the value of [head][crate::model::PullRequest::head].
    pub fn set_head<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::pull_request::Branch>,
    {
        self.head = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [head][crate::model::PullRequest::head].
    pub fn set_or_clear_head<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::pull_request::Branch>,
    {
        self.head = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::PullRequest::state].
    pub fn set_state<T: std::convert::Into<crate::model::pull_request::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::PullRequest::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::PullRequest::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::PullRequest::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::PullRequest::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [close_time][crate::model::PullRequest::close_time].
    pub fn set_close_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.close_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [close_time][crate::model::PullRequest::close_time].
    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.close_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for PullRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest"
    }
}

/// Defines additional types related to [PullRequest].
pub mod pull_request {
    #[allow(unused_imports)]
    use super::*;

    /// Branch represents a branch involved in a pull request.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Branch {
        /// Required. Name of the branch.
        pub r#ref: std::string::String,

        /// Output only. The commit at the tip of the branch.
        pub sha: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Branch {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [r#ref][crate::model::pull_request::Branch::ref].
        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.r#ref = v.into();
            self
        }

        /// Sets the value of [sha][crate::model::pull_request::Branch::sha].
        pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.sha = v.into();
            self
        }
    }

    impl wkt::message::Message for Branch {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest.Branch"
        }
    }

    /// State of the pull request.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified.
        Unspecified,
        /// An open pull request.
        Open,
        /// A closed pull request.
        Closed,
        /// A merged pull request.
        Merged,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Open => std::option::Option::Some(1),
                Self::Closed => std::option::Option::Some(2),
                Self::Merged => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Open => std::option::Option::Some("OPEN"),
                Self::Closed => std::option::Option::Some("CLOSED"),
                Self::Merged => std::option::Option::Some("MERGED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Open,
                2 => Self::Closed,
                3 => Self::Merged,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "OPEN" => Self::Open,
                "CLOSED" => Self::Closed,
                "MERGED" => Self::Merged,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Open => serializer.serialize_i32(1),
                Self::Closed => serializer.serialize_i32(2),
                Self::Merged => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.securesourcemanager.v1.PullRequest.State",
            ))
        }
    }
}

/// Metadata of a FileDiff. FileDiff represents a single file diff in a pull
/// request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileDiff {
    /// Output only. The name of the file.
    pub name: std::string::String,

    /// Output only. The action taken on the file (eg. added, modified, deleted).
    pub action: crate::model::file_diff::Action,

    /// Output only. The commit pointing to the file changes.
    pub sha: std::string::String,

    /// Output only. The git patch containing the file changes.
    pub patch: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FileDiff {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FileDiff::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [action][crate::model::FileDiff::action].
    pub fn set_action<T: std::convert::Into<crate::model::file_diff::Action>>(
        mut self,
        v: T,
    ) -> Self {
        self.action = v.into();
        self
    }

    /// Sets the value of [sha][crate::model::FileDiff::sha].
    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.sha = v.into();
        self
    }

    /// Sets the value of [patch][crate::model::FileDiff::patch].
    pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.patch = v.into();
        self
    }
}

impl wkt::message::Message for FileDiff {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.FileDiff"
    }
}

/// Defines additional types related to [FileDiff].
pub mod file_diff {
    #[allow(unused_imports)]
    use super::*;

    /// Action taken on the file.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Action {
        /// Unspecified.
        Unspecified,
        /// The file was added.
        Added,
        /// The file was modified.
        Modified,
        /// The file was deleted.
        Deleted,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Action::value] or
        /// [Action::name].
        UnknownValue(action::UnknownValue),
    }

    #[doc(hidden)]
    pub mod action {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Action {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Added => std::option::Option::Some(1),
                Self::Modified => std::option::Option::Some(2),
                Self::Deleted => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
                Self::Added => std::option::Option::Some("ADDED"),
                Self::Modified => std::option::Option::Some("MODIFIED"),
                Self::Deleted => std::option::Option::Some("DELETED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Action {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Action {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Action {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Added,
                2 => Self::Modified,
                3 => Self::Deleted,
                _ => Self::UnknownValue(action::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Action {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ACTION_UNSPECIFIED" => Self::Unspecified,
                "ADDED" => Self::Added,
                "MODIFIED" => Self::Modified,
                "DELETED" => Self::Deleted,
                _ => Self::UnknownValue(action::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Action {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Added => serializer.serialize_i32(1),
                Self::Modified => serializer.serialize_i32(2),
                Self::Deleted => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Action {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
                ".google.cloud.securesourcemanager.v1.FileDiff.Action",
            ))
        }
    }
}

/// Metadata of an Issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Issue {
    /// Identifier. Unique identifier for an issue. The issue id is generated by
    /// the server. Format:
    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`
    pub name: std::string::String,

    /// Required. Issue title.
    pub title: std::string::String,

    /// Optional. Issue body. Provides a detailed description of the issue.
    pub body: std::string::String,

    /// Output only. State of the issue.
    pub state: crate::model::issue::State,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last updated timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Close timestamp (if closed). Cleared when is re-opened.
    pub close_time: std::option::Option<wkt::Timestamp>,

    /// Optional. This checksum is computed by the server based on the value of
    /// other fields, and may be sent on update and delete requests to ensure the
    /// client has an up-to-date value before proceeding.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Issue {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Issue::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [title][crate::model::Issue::title].
    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.title = v.into();
        self
    }

    /// Sets the value of [body][crate::model::Issue::body].
    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.body = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Issue::state].
    pub fn set_state<T: std::convert::Into<crate::model::issue::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Issue::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Issue::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Issue::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Issue::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [close_time][crate::model::Issue::close_time].
    pub fn set_close_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.close_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [close_time][crate::model::Issue::close_time].
    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.close_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [etag][crate::model::Issue::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for Issue {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.Issue"
    }
}

/// Defines additional types related to [Issue].
pub mod issue {
    #[allow(unused_imports)]
    use super::*;

    /// Possible states of an issue.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified.
        Unspecified,
        /// An open issue.
        Open,
        /// A closed issue.
        Closed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Open => std::option::Option::Some(1),
                Self::Closed => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Open => std::option::Option::Some("OPEN"),
                Self::Closed => std::option::Option::Some("CLOSED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Open,
                2 => Self::Closed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "OPEN" => Self::Open,
                "CLOSED" => Self::Closed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Open => serializer.serialize_i32(1),
                Self::Closed => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.securesourcemanager.v1.Issue.State",
            ))
        }
    }
}

/// IssueComment represents a comment on an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IssueComment {
    /// Identifier. Unique identifier for an issue comment. The comment id is
    /// generated by the server. Format:
    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}`
    pub name: std::string::String,

    /// Required. The comment body.
    pub body: std::string::String,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last updated timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IssueComment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::IssueComment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [body][crate::model::IssueComment::body].
    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.body = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::IssueComment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::IssueComment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::IssueComment::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::IssueComment::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for IssueComment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.IssueComment"
    }
}

/// PullRequestComment represents a comment on a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PullRequestComment {
    /// Identifier. Unique identifier for the pull request comment. The comment id
    /// is generated by the server. Format:
    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}`
    pub name: std::string::String,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last updated timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The comment detail. A comment can be a review, a general comment, or a
    /// code comment.
    pub comment_detail: std::option::Option<crate::model::pull_request_comment::CommentDetail>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PullRequestComment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PullRequestComment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::PullRequestComment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::PullRequestComment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::PullRequestComment::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::PullRequestComment::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail].
    ///
    /// Note that all the setters affecting `comment_detail` are mutually
    /// exclusive.
    pub fn set_comment_detail<
        T: std::convert::Into<std::option::Option<crate::model::pull_request_comment::CommentDetail>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.comment_detail = v.into();
        self
    }

    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// if it holds a `Review`, `None` if the field is not set or
    /// holds a different branch.
    pub fn review(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Review>> {
        #[allow(unreachable_patterns)]
        self.comment_detail.as_ref().and_then(|v| match v {
            crate::model::pull_request_comment::CommentDetail::Review(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// to hold a `Review`.
    ///
    /// Note that all the setters affecting `comment_detail` are
    /// mutually exclusive.
    pub fn set_review<
        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Review>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.comment_detail = std::option::Option::Some(
            crate::model::pull_request_comment::CommentDetail::Review(v.into()),
        );
        self
    }

    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// if it holds a `Comment`, `None` if the field is not set or
    /// holds a different branch.
    pub fn comment(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Comment>> {
        #[allow(unreachable_patterns)]
        self.comment_detail.as_ref().and_then(|v| match v {
            crate::model::pull_request_comment::CommentDetail::Comment(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// to hold a `Comment`.
    ///
    /// Note that all the setters affecting `comment_detail` are
    /// mutually exclusive.
    pub fn set_comment<
        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Comment>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.comment_detail = std::option::Option::Some(
            crate::model::pull_request_comment::CommentDetail::Comment(v.into()),
        );
        self
    }

    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// if it holds a `Code`, `None` if the field is not set or
    /// holds a different branch.
    pub fn code(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Code>> {
        #[allow(unreachable_patterns)]
        self.comment_detail.as_ref().and_then(|v| match v {
            crate::model::pull_request_comment::CommentDetail::Code(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
    /// to hold a `Code`.
    ///
    /// Note that all the setters affecting `comment_detail` are
    /// mutually exclusive.
    pub fn set_code<
        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Code>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.comment_detail = std::option::Option::Some(
            crate::model::pull_request_comment::CommentDetail::Code(v.into()),
        );
        self
    }
}

impl wkt::message::Message for PullRequestComment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment"
    }
}

/// Defines additional types related to [PullRequestComment].
pub mod pull_request_comment {
    #[allow(unused_imports)]
    use super::*;

    /// The review summary comment.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Review {
        /// Required. The review action type.
        pub action_type: crate::model::pull_request_comment::review::ActionType,

        /// Optional. The comment body.
        pub body: std::string::String,

        /// Output only. The effective commit sha this review is pointing to.
        pub effective_commit_sha: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Review {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [action_type][crate::model::pull_request_comment::Review::action_type].
        pub fn set_action_type<
            T: std::convert::Into<crate::model::pull_request_comment::review::ActionType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.action_type = v.into();
            self
        }

        /// Sets the value of [body][crate::model::pull_request_comment::Review::body].
        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.body = v.into();
            self
        }

        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Review::effective_commit_sha].
        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.effective_commit_sha = v.into();
            self
        }
    }

    impl wkt::message::Message for Review {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Review"
        }
    }

    /// Defines additional types related to [Review].
    pub mod review {
        #[allow(unused_imports)]
        use super::*;

        /// The review action type.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ActionType {
            /// Unspecified.
            Unspecified,
            /// A general review comment.
            Comment,
            /// Change required from this review.
            ChangeRequested,
            /// Change approved from this review.
            Approved,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [ActionType::value] or
            /// [ActionType::name].
            UnknownValue(action_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod action_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl ActionType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Comment => std::option::Option::Some(1),
                    Self::ChangeRequested => std::option::Option::Some(2),
                    Self::Approved => std::option::Option::Some(3),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
                    Self::Comment => std::option::Option::Some("COMMENT"),
                    Self::ChangeRequested => std::option::Option::Some("CHANGE_REQUESTED"),
                    Self::Approved => std::option::Option::Some("APPROVED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for ActionType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for ActionType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for ActionType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Comment,
                    2 => Self::ChangeRequested,
                    3 => Self::Approved,
                    _ => Self::UnknownValue(action_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for ActionType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "COMMENT" => Self::Comment,
                    "CHANGE_REQUESTED" => Self::ChangeRequested,
                    "APPROVED" => Self::Approved,
                    _ => Self::UnknownValue(action_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for ActionType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Comment => serializer.serialize_i32(1),
                    Self::ChangeRequested => serializer.serialize_i32(2),
                    Self::Approved => serializer.serialize_i32(3),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for ActionType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
                    ".google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType",
                ))
            }
        }
    }

    /// The general pull request comment.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Comment {
        /// Required. The comment body.
        pub body: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Comment {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [body][crate::model::pull_request_comment::Comment::body].
        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.body = v.into();
            self
        }
    }

    impl wkt::message::Message for Comment {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Comment"
        }
    }

    /// The comment on a code line.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Code {
        /// Required. The comment body.
        pub body: std::string::String,

        /// Optional. Input only. The PullRequestComment resource name that this
        /// comment is replying to.
        pub reply: std::string::String,

        /// Optional. The position of the comment.
        pub position: std::option::Option<crate::model::pull_request_comment::Position>,

        /// Output only. The root comment of the conversation, derived from the reply
        /// field.
        pub effective_root_comment: std::string::String,

        /// Output only. Boolean indicator if the comment is resolved.
        pub resolved: bool,

        /// Output only. The effective commit sha this code comment is pointing to.
        pub effective_commit_sha: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Code {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [body][crate::model::pull_request_comment::Code::body].
        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.body = v.into();
            self
        }

        /// Sets the value of [reply][crate::model::pull_request_comment::Code::reply].
        pub fn set_reply<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.reply = v.into();
            self
        }

        /// Sets the value of [position][crate::model::pull_request_comment::Code::position].
        pub fn set_position<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::pull_request_comment::Position>,
        {
            self.position = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [position][crate::model::pull_request_comment::Code::position].
        pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::pull_request_comment::Position>,
        {
            self.position = v.map(|x| x.into());
            self
        }

        /// Sets the value of [effective_root_comment][crate::model::pull_request_comment::Code::effective_root_comment].
        pub fn set_effective_root_comment<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.effective_root_comment = v.into();
            self
        }

        /// Sets the value of [resolved][crate::model::pull_request_comment::Code::resolved].
        pub fn set_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.resolved = v.into();
            self
        }

        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Code::effective_commit_sha].
        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.effective_commit_sha = v.into();
            self
        }
    }

    impl wkt::message::Message for Code {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Code"
        }
    }

    /// The position of the code comment.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Position {
        /// Required. The path of the file.
        pub path: std::string::String,

        /// Required. The line number of the comment. Positive value means it's on
        /// the new side of the diff, negative value means it's on the old side.
        pub line: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Position {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [path][crate::model::pull_request_comment::Position::path].
        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.path = v.into();
            self
        }

        /// Sets the value of [line][crate::model::pull_request_comment::Position::line].
        pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.line = v.into();
            self
        }
    }

    impl wkt::message::Message for Position {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Position"
        }
    }

    /// The comment detail. A comment can be a review, a general comment, or a
    /// code comment.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CommentDetail {
        /// Optional. The review summary comment.
        Review(std::boxed::Box<crate::model::pull_request_comment::Review>),
        /// Optional. The general pull request comment.
        Comment(std::boxed::Box<crate::model::pull_request_comment::Comment>),
        /// Optional. The comment on a code line.
        Code(std::boxed::Box<crate::model::pull_request_comment::Code>),
    }
}

/// ListInstancesRequest is the request to list instances.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesRequest {
    /// Required. Parent value for ListInstancesRequest.
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filter for filtering results.
    pub filter: std::string::String,

    /// Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInstancesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInstancesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesRequest"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesResponse {
    /// The list of instances.
    pub instances: std::vec::Vec<crate::model::Instance>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInstancesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
    pub fn set_instances<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Instance>,
    {
        use std::iter::Iterator;
        self.instances = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInstancesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
    type PageItem = crate::model::Instance;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.instances
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// GetInstanceRequest is the request for getting an instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInstanceRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetInstanceRequest"
    }
}

/// CreateInstanceRequest is the request for creating an instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceRequest {
    /// Required. Value for parent.
    pub parent: std::string::String,

    /// Required. ID of the instance to be created.
    pub instance_id: std::string::String,

    /// Required. The resource being created.
    pub instance: std::option::Option<crate::model::Instance>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.instance_id = v.into();
        self
    }

    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
    pub fn set_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Instance>,
    {
        self.instance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateInstanceRequest"
    }
}

/// DeleteInstanceRequest is the request for deleting an instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInstanceRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteInstanceRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][google.longrunning.Operation.error] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata"
    }
}

/// ListRepositoriesRequest is request to list repositories.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRepositoriesRequest {
    /// Required. Parent value for ListRepositoriesRequest.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filter results.
    pub filter: std::string::String,

    /// Optional. The name of the instance in which the repository is hosted,
    /// formatted as
    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
    /// When listing repositories via securesourcemanager.googleapis.com, this
    /// field is required. When listing repositories via *.sourcemanager.dev, this
    /// field is ignored.
    pub instance: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRepositoriesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [instance][crate::model::ListRepositoriesRequest::instance].
    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.instance = v.into();
        self
    }
}

impl wkt::message::Message for ListRepositoriesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesRequest"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRepositoriesResponse {
    /// The list of repositories.
    pub repositories: std::vec::Vec<crate::model::Repository>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRepositoriesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
    pub fn set_repositories<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Repository>,
    {
        use std::iter::Iterator;
        self.repositories = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListRepositoriesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
    type PageItem = crate::model::Repository;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.repositories
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// GetRepositoryRequest is the request for getting a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRepositoryRequest {
    /// Required. Name of the repository to retrieve.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetRepositoryRequest"
    }
}

/// CreateRepositoryRequest is the request for creating a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRepositoryRequest {
    /// Required. The project in which to create the repository. Values are of the
    /// form `projects/{project_number}/locations/{location_id}`
    pub parent: std::string::String,

    /// Required. The resource being created.
    pub repository: std::option::Option<crate::model::Repository>,

    /// Required. The ID to use for the repository, which will become the final
    /// component of the repository's resource name. This value should be 4-63
    /// characters, and valid characters are /[a-z][0-9]-/.
    pub repository_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
    pub fn set_repository<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = v.map(|x| x.into());
        self
    }

    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.repository_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateRepositoryRequest"
    }
}

/// UpdateRepositoryRequest is the request to update a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRepositoryRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// repository resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The repository being updated.
    pub repository: std::option::Option<crate::model::Repository>,

    /// Optional. False by default. If set to true, the request is validated and
    /// the user is provided with an expected result, but no actual change is made.
    pub validate_only: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
    pub fn set_repository<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Repository>,
    {
        self.repository = v.map(|x| x.into());
        self
    }

    /// Sets the value of [validate_only][crate::model::UpdateRepositoryRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }
}

impl wkt::message::Message for UpdateRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateRepositoryRequest"
    }
}

/// DeleteRepositoryRequest is the request to delete a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRepositoryRequest {
    /// Required. Name of the repository to delete.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
    pub name: std::string::String,

    /// Optional. If set to true, and the repository is not found, the request will
    /// succeed but no action will be taken on the server.
    pub allow_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteRepositoryRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [allow_missing][crate::model::DeleteRepositoryRequest::allow_missing].
    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_missing = v.into();
        self
    }
}

impl wkt::message::Message for DeleteRepositoryRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteRepositoryRequest"
    }
}

/// ListHooksRequest is request to list hooks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHooksRequest {
    /// Required. Parent value for ListHooksRequest.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHooksRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListHooksRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListHooksRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListHooksRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListHooksRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksRequest"
    }
}

/// ListHooksResponse is response to list hooks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHooksResponse {
    /// The list of hooks.
    pub hooks: std::vec::Vec<crate::model::Hook>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHooksResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [hooks][crate::model::ListHooksResponse::hooks].
    pub fn set_hooks<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Hook>,
    {
        use std::iter::Iterator;
        self.hooks = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListHooksResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListHooksResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListHooksResponse {
    type PageItem = crate::model::Hook;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.hooks
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// GetHookRequest is the request for getting a hook.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetHookRequest {
    /// Required. Name of the hook to retrieve.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetHookRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetHookRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetHookRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetHookRequest"
    }
}

/// CreateHookRequest is the request for creating a hook.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateHookRequest {
    /// Required. The repository in which to create the hook. Values are of the
    /// form
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
    pub parent: std::string::String,

    /// Required. The resource being created.
    pub hook: std::option::Option<crate::model::Hook>,

    /// Required. The ID to use for the hook, which will become the final component
    /// of the hook's resource name. This value restricts to lower-case letters,
    /// numbers, and hyphen, with the first character a letter, the last a letter
    /// or a number, and a 63 character maximum.
    pub hook_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateHookRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateHookRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [hook][crate::model::CreateHookRequest::hook].
    pub fn set_hook<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Hook>,
    {
        self.hook = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hook][crate::model::CreateHookRequest::hook].
    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Hook>,
    {
        self.hook = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hook_id][crate::model::CreateHookRequest::hook_id].
    pub fn set_hook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.hook_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateHookRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateHookRequest"
    }
}

/// UpdateHookRequest is the request to update a hook.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateHookRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// hook resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    /// The special value "*" means full replacement.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The hook being updated.
    pub hook: std::option::Option<crate::model::Hook>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateHookRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hook][crate::model::UpdateHookRequest::hook].
    pub fn set_hook<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Hook>,
    {
        self.hook = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hook][crate::model::UpdateHookRequest::hook].
    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Hook>,
    {
        self.hook = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateHookRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateHookRequest"
    }
}

/// DeleteHookRequest is the request to delete a hook.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteHookRequest {
    /// Required. Name of the hook to delete.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteHookRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteHookRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteHookRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteHookRequest"
    }
}

/// GetBranchRuleRequest is the request for getting a branch rule.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBranchRuleRequest {
    /// Required. Name of the repository to retrieve.
    /// The format is
    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetBranchRuleRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetBranchRuleRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetBranchRuleRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetBranchRuleRequest"
    }
}

/// CreateBranchRuleRequest is the request to create a branch rule.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBranchRuleRequest {
    pub parent: std::string::String,

    pub branch_rule: std::option::Option<crate::model::BranchRule>,

    pub branch_rule_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateBranchRuleRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateBranchRuleRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
    pub fn set_branch_rule<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BranchRule>,
    {
        self.branch_rule = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::BranchRule>,
    {
        self.branch_rule = v.map(|x| x.into());
        self
    }

    /// Sets the value of [branch_rule_id][crate::model::CreateBranchRuleRequest::branch_rule_id].
    pub fn set_branch_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.branch_rule_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateBranchRuleRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateBranchRuleRequest"
    }
}

/// ListBranchRulesRequest is the request to list branch rules.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBranchRulesRequest {
    pub parent: std::string::String,

    pub page_size: i32,

    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBranchRulesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListBranchRulesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListBranchRulesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListBranchRulesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListBranchRulesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesRequest"
    }
}

/// DeleteBranchRuleRequest is the request to delete a branch rule.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBranchRuleRequest {
    pub name: std::string::String,

    /// Optional. If set to true, and the branch rule is not found, the request
    /// will succeed but no action will be taken on the server.
    pub allow_missing: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteBranchRuleRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteBranchRuleRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [allow_missing][crate::model::DeleteBranchRuleRequest::allow_missing].
    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_missing = v.into();
        self
    }
}

impl wkt::message::Message for DeleteBranchRuleRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest"
    }
}

/// UpdateBranchRuleRequest is the request to update a branchRule.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBranchRuleRequest {
    pub branch_rule: std::option::Option<crate::model::BranchRule>,

    /// Optional. If set, validate the request and preview the review, but do not
    /// actually post it.  (<https://google.aip.dev/163>, for declarative friendly)
    pub validate_only: bool,

    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// branchRule resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    /// The special value "*" means full replacement.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateBranchRuleRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
    pub fn set_branch_rule<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::BranchRule>,
    {
        self.branch_rule = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::BranchRule>,
    {
        self.branch_rule = v.map(|x| x.into());
        self
    }

    /// Sets the value of [validate_only][crate::model::UpdateBranchRuleRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateBranchRuleRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest"
    }
}

/// ListBranchRulesResponse is the response to listing branchRules.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBranchRulesResponse {
    /// The list of branch rules.
    pub branch_rules: std::vec::Vec<crate::model::BranchRule>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBranchRulesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [branch_rules][crate::model::ListBranchRulesResponse::branch_rules].
    pub fn set_branch_rules<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::BranchRule>,
    {
        use std::iter::Iterator;
        self.branch_rules = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListBranchRulesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListBranchRulesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListBranchRulesResponse {
    type PageItem = crate::model::BranchRule;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.branch_rules
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// CreatePullRequestRequest is the request to create a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePullRequestRequest {
    /// Required. The repository that the pull request is created from. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
    pub parent: std::string::String,

    /// Required. The pull request to create.
    pub pull_request: std::option::Option<crate::model::PullRequest>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePullRequestRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
    pub fn set_pull_request<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PullRequest>,
    {
        self.pull_request = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PullRequest>,
    {
        self.pull_request = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreatePullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestRequest"
    }
}

/// GetPullRequestRequest is the request to get a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPullRequestRequest {
    /// Required. Name of the pull request to retrieve.
    /// The format is
    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPullRequestRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestRequest"
    }
}

/// ListPullRequestsRequest is the request to list pull requests.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestsRequest {
    /// Required. The repository in which to list pull requests. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPullRequestsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPullRequestsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPullRequestsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsRequest"
    }
}

/// ListPullRequestsResponse is the response to list pull requests.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestsResponse {
    /// The list of pull requests.
    pub pull_requests: std::vec::Vec<crate::model::PullRequest>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_requests][crate::model::ListPullRequestsResponse::pull_requests].
    pub fn set_pull_requests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PullRequest>,
    {
        use std::iter::Iterator;
        self.pull_requests = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPullRequestsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPullRequestsResponse {
    type PageItem = crate::model::PullRequest;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.pull_requests
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// UpdatePullRequestRequest is the request to update a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePullRequestRequest {
    /// Required. The pull request to update.
    pub pull_request: std::option::Option<crate::model::PullRequest>,

    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// pull request resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    /// The special value "*" means full replacement.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdatePullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
    pub fn set_pull_request<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PullRequest>,
    {
        self.pull_request = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PullRequest>,
    {
        self.pull_request = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdatePullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestRequest"
    }
}

/// MergePullRequestRequest is the request to merge a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MergePullRequestRequest {
    /// Required. The pull request to merge.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MergePullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::MergePullRequestRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for MergePullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.MergePullRequestRequest"
    }
}

/// OpenPullRequestRequest is the request to open a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenPullRequestRequest {
    /// Required. The pull request to open.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OpenPullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::OpenPullRequestRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for OpenPullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenPullRequestRequest"
    }
}

/// ClosePullRequestRequest is the request to close a pull request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClosePullRequestRequest {
    /// Required. The pull request to close.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ClosePullRequestRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ClosePullRequestRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for ClosePullRequestRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ClosePullRequestRequest"
    }
}

/// ListPullRequestFileDiffsRequest is the request to list pull request file
/// diffs.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestFileDiffsRequest {
    /// Required. The pull request to list file diffs for.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub name: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestFileDiffsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ListPullRequestFileDiffsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPullRequestFileDiffsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPullRequestFileDiffsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestFileDiffsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest"
    }
}

/// ListPullRequestFileDiffsResponse is the response containing file diffs
/// returned from ListPullRequestFileDiffs.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestFileDiffsResponse {
    /// The list of pull request file diffs.
    pub file_diffs: std::vec::Vec<crate::model::FileDiff>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestFileDiffsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [file_diffs][crate::model::ListPullRequestFileDiffsResponse::file_diffs].
    pub fn set_file_diffs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::FileDiff>,
    {
        use std::iter::Iterator;
        self.file_diffs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPullRequestFileDiffsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestFileDiffsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPullRequestFileDiffsResponse {
    type PageItem = crate::model::FileDiff;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.file_diffs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request to create an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIssueRequest {
    /// Required. The repository in which to create the issue. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
    pub parent: std::string::String,

    /// Required. The issue to create.
    pub issue: std::option::Option<crate::model::Issue>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateIssueRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [issue][crate::model::CreateIssueRequest::issue].
    pub fn set_issue<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Issue>,
    {
        self.issue = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [issue][crate::model::CreateIssueRequest::issue].
    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Issue>,
    {
        self.issue = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueRequest"
    }
}

/// The request to get an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIssueRequest {
    /// Required. Name of the issue to retrieve.
    /// The format is
    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetIssueRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueRequest"
    }
}

/// The request to list issues.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIssuesRequest {
    /// Required. The repository in which to list issues. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Used to filter the resulting issues list.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIssuesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListIssuesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListIssuesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListIssuesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListIssuesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesRequest"
    }
}

/// The response to list issues.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIssuesResponse {
    /// The list of issues.
    pub issues: std::vec::Vec<crate::model::Issue>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIssuesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issues][crate::model::ListIssuesResponse::issues].
    pub fn set_issues<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Issue>,
    {
        use std::iter::Iterator;
        self.issues = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListIssuesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIssuesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListIssuesResponse {
    type PageItem = crate::model::Issue;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.issues
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request to update an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIssueRequest {
    /// Required. The issue to update.
    pub issue: std::option::Option<crate::model::Issue>,

    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// issue resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    /// The special value "*" means full replacement.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
    pub fn set_issue<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Issue>,
    {
        self.issue = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Issue>,
    {
        self.issue = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueRequest"
    }
}

/// The request to delete an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIssueRequest {
    /// Required. Name of the issue to delete.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
    pub name: std::string::String,

    /// Optional. The current etag of the issue.
    /// If the etag is provided and does not match the current etag of the issue,
    /// deletion will be blocked and an ABORTED error will be returned.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteIssueRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for DeleteIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueRequest"
    }
}

/// The request to close an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloseIssueRequest {
    /// Required. Name of the issue to close.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
    pub name: std::string::String,

    /// Optional. The current etag of the issue.
    /// If the etag is provided and does not match the current etag of the issue,
    /// closing will be blocked and an ABORTED error will be returned.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CloseIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CloseIssueRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::CloseIssueRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for CloseIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CloseIssueRequest"
    }
}

/// The request to open an issue.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenIssueRequest {
    /// Required. Name of the issue to open.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
    pub name: std::string::String,

    /// Optional. The current etag of the issue.
    /// If the etag is provided and does not match the current etag of the issue,
    /// opening will be blocked and an ABORTED error will be returned.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OpenIssueRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::OpenIssueRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::OpenIssueRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for OpenIssueRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenIssueRequest"
    }
}

/// Represents an entry within a tree structure (like a Git tree).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TreeEntry {
    /// Output only. The type of the object (TREE, BLOB, COMMIT).  Output-only.
    pub r#type: crate::model::tree_entry::ObjectType,

    /// Output only. The SHA-1 hash of the object (unique identifier). Output-only.
    pub sha: std::string::String,

    /// Output only. The path of the file or directory within the tree (e.g.,
    /// "src/main/java/MyClass.java"). Output-only.
    pub path: std::string::String,

    /// Output only. The file mode as a string (e.g., "100644"). Indicates file
    /// type. Output-only.
    pub mode: std::string::String,

    /// Output only. The size of the object in bytes (only for blobs). Output-only.
    pub size: i64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TreeEntry {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [r#type][crate::model::TreeEntry::type].
    pub fn set_type<T: std::convert::Into<crate::model::tree_entry::ObjectType>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [sha][crate::model::TreeEntry::sha].
    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.sha = v.into();
        self
    }

    /// Sets the value of [path][crate::model::TreeEntry::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [mode][crate::model::TreeEntry::mode].
    pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mode = v.into();
        self
    }

    /// Sets the value of [size][crate::model::TreeEntry::size].
    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.size = v.into();
        self
    }
}

impl wkt::message::Message for TreeEntry {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.TreeEntry"
    }
}

/// Defines additional types related to [TreeEntry].
pub mod tree_entry {
    #[allow(unused_imports)]
    use super::*;

    /// Defines the type of object the TreeEntry represents.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ObjectType {
        /// Default value, indicating the object type is unspecified.
        Unspecified,
        /// Represents a directory (folder).
        Tree,
        /// Represents a file (contains file data).
        Blob,
        /// Represents a pointer to another repository (submodule).
        Commit,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ObjectType::value] or
        /// [ObjectType::name].
        UnknownValue(object_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod object_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ObjectType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Tree => std::option::Option::Some(1),
                Self::Blob => std::option::Option::Some(2),
                Self::Commit => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OBJECT_TYPE_UNSPECIFIED"),
                Self::Tree => std::option::Option::Some("TREE"),
                Self::Blob => std::option::Option::Some("BLOB"),
                Self::Commit => std::option::Option::Some("COMMIT"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ObjectType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ObjectType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ObjectType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Tree,
                2 => Self::Blob,
                3 => Self::Commit,
                _ => Self::UnknownValue(object_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ObjectType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OBJECT_TYPE_UNSPECIFIED" => Self::Unspecified,
                "TREE" => Self::Tree,
                "BLOB" => Self::Blob,
                "COMMIT" => Self::Commit,
                _ => Self::UnknownValue(object_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ObjectType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Tree => serializer.serialize_i32(1),
                Self::Blob => serializer.serialize_i32(2),
                Self::Commit => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ObjectType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ObjectType>::new(
                ".google.cloud.securesourcemanager.v1.TreeEntry.ObjectType",
            ))
        }
    }
}

/// Request message for fetching a tree structure from a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchTreeRequest {
    /// Required. The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
    /// Specifies the repository to fetch the tree from.
    pub repository: std::string::String,

    /// Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies
    /// which tree to fetch. If not specified, the default branch will be used.
    pub r#ref: std::string::String,

    /// Optional. If true, include all subfolders and their files in the response.
    /// If false, only the immediate children are returned.
    pub recursive: bool,

    /// Optional. Requested page size.  Server may return fewer items than
    /// requested. If unspecified, at most 10,000 items will be returned.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchTreeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [repository][crate::model::FetchTreeRequest::repository].
    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.repository = v.into();
        self
    }

    /// Sets the value of [r#ref][crate::model::FetchTreeRequest::ref].
    pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.r#ref = v.into();
        self
    }

    /// Sets the value of [recursive][crate::model::FetchTreeRequest::recursive].
    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.recursive = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::FetchTreeRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::FetchTreeRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for FetchTreeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeRequest"
    }
}

/// Response message containing a list of TreeEntry objects.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchTreeResponse {
    /// The list of TreeEntry objects.
    pub tree_entries: std::vec::Vec<crate::model::TreeEntry>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchTreeResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [tree_entries][crate::model::FetchTreeResponse::tree_entries].
    pub fn set_tree_entries<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::TreeEntry>,
    {
        use std::iter::Iterator;
        self.tree_entries = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::FetchTreeResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for FetchTreeResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for FetchTreeResponse {
    type PageItem = crate::model::TreeEntry;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.tree_entries
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for fetching a blob (file content) from a repository.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchBlobRequest {
    /// Required. The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
    /// Specifies the repository containing the blob.
    pub repository: std::string::String,

    /// Required. The SHA-1 hash of the blob to retrieve.
    pub sha: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchBlobRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [repository][crate::model::FetchBlobRequest::repository].
    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.repository = v.into();
        self
    }

    /// Sets the value of [sha][crate::model::FetchBlobRequest::sha].
    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.sha = v.into();
        self
    }
}

impl wkt::message::Message for FetchBlobRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobRequest"
    }
}

/// Response message containing the content of a blob.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchBlobResponse {
    /// The SHA-1 hash of the blob.
    pub sha: std::string::String,

    /// The content of the blob, encoded as base64.
    pub content: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FetchBlobResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [sha][crate::model::FetchBlobResponse::sha].
    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.sha = v.into();
        self
    }

    /// Sets the value of [content][crate::model::FetchBlobResponse::content].
    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content = v.into();
        self
    }
}

impl wkt::message::Message for FetchBlobResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobResponse"
    }
}

/// The request to list pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestCommentsRequest {
    /// Required. The pull request in which to list pull request comments. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub parent: std::string::String,

    /// Optional. Requested page size. If unspecified, at most 100 pull request
    /// comments will be returned. The maximum value is 100; values above 100 will
    /// be coerced to 100.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestCommentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPullRequestCommentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPullRequestCommentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPullRequestCommentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestCommentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest"
    }
}

/// The response to list pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPullRequestCommentsResponse {
    /// The list of pull request comments.
    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,

    /// A token to set as page_token to retrieve the next page. If this field is
    /// omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPullRequestCommentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request_comments][crate::model::ListPullRequestCommentsResponse::pull_request_comments].
    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PullRequestComment>,
    {
        use std::iter::Iterator;
        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPullRequestCommentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPullRequestCommentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPullRequestCommentsResponse {
    type PageItem = crate::model::PullRequestComment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.pull_request_comments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request to create a pull request comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePullRequestCommentRequest {
    /// Required. The pull request in which to create the pull request comment.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub parent: std::string::String,

    /// Required. The pull request comment to create.
    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePullRequestCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePullRequestCommentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PullRequestComment>,
    {
        self.pull_request_comment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PullRequestComment>,
    {
        self.pull_request_comment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreatePullRequestCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest"
    }
}

/// The request to batch create pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchCreatePullRequestCommentsRequest {
    /// Required. The pull request in which to create the pull request comments.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub parent: std::string::String,

    /// Required. The request message specifying the resources to create. There
    /// should be exactly one CreatePullRequestCommentRequest with CommentDetail
    /// being REVIEW in the list, and no more than 100
    /// CreatePullRequestCommentRequests with CommentDetail being CODE in the list
    pub requests: std::vec::Vec<crate::model::CreatePullRequestCommentRequest>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BatchCreatePullRequestCommentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::BatchCreatePullRequestCommentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [requests][crate::model::BatchCreatePullRequestCommentsRequest::requests].
    pub fn set_requests<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
    {
        use std::iter::Iterator;
        self.requests = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for BatchCreatePullRequestCommentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest"
    }
}

/// The response to batch create pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchCreatePullRequestCommentsResponse {
    /// The list of pull request comments created.
    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BatchCreatePullRequestCommentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request_comments][crate::model::BatchCreatePullRequestCommentsResponse::pull_request_comments].
    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PullRequestComment>,
    {
        use std::iter::Iterator;
        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for BatchCreatePullRequestCommentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse"
    }
}

/// The request to update a pull request comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePullRequestCommentRequest {
    /// Required. The pull request comment to update.
    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,

    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// pull request comment resource by the update. Updatable fields are
    /// `body`.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdatePullRequestCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PullRequestComment>,
    {
        self.pull_request_comment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PullRequestComment>,
    {
        self.pull_request_comment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdatePullRequestCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest"
    }
}

/// The request to delete a pull request comment. A Review PullRequestComment
/// cannot be deleted.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePullRequestCommentRequest {
    /// Required. Name of the pull request comment to delete.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeletePullRequestCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeletePullRequestCommentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeletePullRequestCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest"
    }
}

/// The request to get a pull request comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPullRequestCommentRequest {
    /// Required. Name of the pull request comment to retrieve.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPullRequestCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPullRequestCommentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPullRequestCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest"
    }
}

/// The request to resolve multiple pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResolvePullRequestCommentsRequest {
    /// Required. The pull request in which to resolve the pull request comments.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub parent: std::string::String,

    /// Required. The names of the pull request comments to resolve. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
    /// Only comments from the same threads are allowed in the same request.
    pub names: std::vec::Vec<std::string::String>,

    /// Optional. If set, at least one comment in a thread is required, rest of the
    /// comments in the same thread will be automatically updated to resolved. If
    /// unset, all comments in the same thread need be present.
    pub auto_fill: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResolvePullRequestCommentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ResolvePullRequestCommentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [names][crate::model::ResolvePullRequestCommentsRequest::names].
    pub fn set_names<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.names = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [auto_fill][crate::model::ResolvePullRequestCommentsRequest::auto_fill].
    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.auto_fill = v.into();
        self
    }
}

impl wkt::message::Message for ResolvePullRequestCommentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest"
    }
}

/// The response to resolve multiple pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResolvePullRequestCommentsResponse {
    /// The list of pull request comments resolved.
    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResolvePullRequestCommentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request_comments][crate::model::ResolvePullRequestCommentsResponse::pull_request_comments].
    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PullRequestComment>,
    {
        use std::iter::Iterator;
        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ResolvePullRequestCommentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse"
    }
}

/// The request to unresolve multiple pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UnresolvePullRequestCommentsRequest {
    /// Required. The pull request in which to resolve the pull request comments.
    /// Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
    pub parent: std::string::String,

    /// Required. The names of the pull request comments to unresolve. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
    /// Only comments from the same threads are allowed in the same request.
    pub names: std::vec::Vec<std::string::String>,

    /// Optional. If set, at least one comment in a thread is required, rest of the
    /// comments in the same thread will be automatically updated to unresolved. If
    /// unset, all comments in the same thread need be present.
    pub auto_fill: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UnresolvePullRequestCommentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::UnresolvePullRequestCommentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [names][crate::model::UnresolvePullRequestCommentsRequest::names].
    pub fn set_names<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.names = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [auto_fill][crate::model::UnresolvePullRequestCommentsRequest::auto_fill].
    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.auto_fill = v.into();
        self
    }
}

impl wkt::message::Message for UnresolvePullRequestCommentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest"
    }
}

/// The response to unresolve multiple pull request comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UnresolvePullRequestCommentsResponse {
    /// The list of pull request comments unresolved.
    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UnresolvePullRequestCommentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [pull_request_comments][crate::model::UnresolvePullRequestCommentsResponse::pull_request_comments].
    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PullRequestComment>,
    {
        use std::iter::Iterator;
        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for UnresolvePullRequestCommentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse"
    }
}

/// The request to create an issue comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIssueCommentRequest {
    /// Required. The issue in which to create the issue comment. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
    pub parent: std::string::String,

    /// Required. The issue comment to create.
    pub issue_comment: std::option::Option<crate::model::IssueComment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateIssueCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateIssueCommentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
    pub fn set_issue_comment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IssueComment>,
    {
        self.issue_comment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IssueComment>,
    {
        self.issue_comment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateIssueCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueCommentRequest"
    }
}

/// The request to get an issue comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIssueCommentRequest {
    /// Required. Name of the issue comment to retrieve.
    /// The format is
    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIssueCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetIssueCommentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetIssueCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueCommentRequest"
    }
}

/// The request to list issue comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIssueCommentsRequest {
    /// Required. The issue in which to list the comments. Format:
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIssueCommentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListIssueCommentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListIssueCommentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListIssueCommentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIssueCommentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsRequest"
    }
}

/// The response to list issue comments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIssueCommentsResponse {
    /// The list of issue comments.
    pub issue_comments: std::vec::Vec<crate::model::IssueComment>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIssueCommentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issue_comments][crate::model::ListIssueCommentsResponse::issue_comments].
    pub fn set_issue_comments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::IssueComment>,
    {
        use std::iter::Iterator;
        self.issue_comments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListIssueCommentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIssueCommentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListIssueCommentsResponse {
    type PageItem = crate::model::IssueComment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.issue_comments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request to update an issue comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIssueCommentRequest {
    /// Required. The issue comment to update.
    pub issue_comment: std::option::Option<crate::model::IssueComment>,

    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// issue comment resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask.
    /// The special value "*" means full replacement.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIssueCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
    pub fn set_issue_comment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IssueComment>,
    {
        self.issue_comment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IssueComment>,
    {
        self.issue_comment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateIssueCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest"
    }
}

/// The request to delete an issue comment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIssueCommentRequest {
    /// Required. Name of the issue comment to delete.
    /// The format is
    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteIssueCommentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteIssueCommentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteIssueCommentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest"
    }
}
